package com.qf.day05;

public class Cat {
    String kind;
    String name;
    int age;
    String sex;
    String color;
    int joy;
    double weight;
    public Cat(){
        this.color = "black";
    }
    public Cat(String name){
      this.name = "mao";
    }
    public Cat(String kind, String name, int age, String sex,  int joy, double weight) {
        this.kind = kind;
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.color = color;
        this.joy = joy;
        this.weight = weight;

    }
    public void burbleSort(){
        this.joy=this.joy-15;
        int [] arr={2,1,5,3,4};
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length-i-1; j++) {
                if(arr[j+1]>arr[j]){
                    int temp=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=temp;
                }
            }
        }

        System.out.println("猫在冒泡排序,心情值减少15"+"心情值为"+this.joy);
        System.out.print("排序完了为:");
        System.out.print("[ ");
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }

        System.out.println("]");


    }
    public void eat(){
        this.weight = this.weight +10;
        this.joy = this.joy+5;
        System.out.println("吧唧吧唧吧唧"+"体重增加10"+"体重为"+this.weight);
        System.out.println("吧唧吧唧吧唧"+"心情增加5"+"心情值为"+this.joy);
    }
    public void sleep(){
        this.joy = this.joy+10;
        System.out.println("zzz"+"心情增加5"+"心情值为"+this.joy);
    }
    public void fishing(){
        this.weight = this.weight -5;
        this.joy = this.joy+5;
        System.out.println("猫在钓鱼..."+"体重减少5"+"体重为"+this.weight);
        System.out.println("猫在钓鱼..."+"心情增加5"+"心情值为"+this.joy);
    }
    public void roll(){
        this.joy = this.joy+20;
        System.out.println("猫在翻滚"+"呼噜呼噜呼噜..."+"心情增加20"+"心情值为"+this.joy);
    }



}
